$(function () {
    echart_map();

    //echart_1湖南各市货运量
    function echart_1() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_1'));
        myChart.clear();
        option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c}万元"
            },
            legend: {
                x: 'center',
                y: '15%',
                data: ['长沙', '株洲', '湘潭', '衡阳', '邵阳', '岳阳', '常德', '张家界', '益阳', '郴州', '永州', '娄底', '怀化', '湘西'],
                icon: 'circle',
                textStyle: {
                    color: '#fff',
                    
                }
            },
            calculable: true,
            series: [{
                name: '',
                type: 'pie',
                //起始角度，支持范围[0, 360]
                startAngle: 0,
                //饼图的半径，数组的第一项是内半径，第二项是外半径
                radius: [41, 280.75],
                //支持设置成百分比，设置成百分比时第一项是相对于容器宽度，第二项是相对于容器高度
                center: ['50%', '40%'],
                //是否展示成南丁格尔图，通过半径区分数据大小。可选择两种模式：
                // 'radius' 面积展现数据的百分比，半径展现数据的大小。
                //  'area' 所有扇区面积相同，仅通过半径展现数据大小
                roseType: 'area',
                //是否启用防止标签重叠策略，默认开启，圆环图这个例子中需要强制所有标签放在中心位置，可以将该值设为 false。
                avoidLabelOverlap: false,
                label: {
                    normal: {
                        show: true,
                        formatter: '{c}万元'
                    },
                    emphasis: {
                        show: true
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length2: 1,
                    },
                    emphasis: {
                        show: true
                    }
                },
                data: [{
                    value: 900.58,
                    name: '怀化',
                    itemStyle: {
                        normal: {
                            color: '#f845f1'
                        }
                    }
                },
                    {
                        value: 1100.58,
                        name: '永州',
                        itemStyle: {
                            normal: {
                                color: '#ad46f3'
                            }
                        }
                    },
                    {
                        value: 1200.58,
                        name: '张家界',
                        itemStyle: {
                            normal: {
                                color: '#5045f6'
                            }
                        }
                    },
                    {
                        value: 1300.58,
                        name: '邵阳',
                        itemStyle: {
                            normal: {
                                color: '#4777f5'
                            }
                        }
                    },
                    {
                        value: 1400.58,
                        name: '常德',
                        itemStyle: {
                            normal: {
                                color: '#44aff0'
                            }
                        }
                    },
                    {
                        value: 1500.58,
                        name: '岳阳',
                        itemStyle: {
                            normal: {
                                color: '#45dbf7'
                            }
                        }
                    },
                    {
                        value: 1500.58,
                        name: '湘潭',
                        itemStyle: {
                            normal: {
                                color: '#f6d54a'
                            }
                        }
                    },
                    {
                        value: 1600.58,
                        name: '株洲',
                        itemStyle: {
                            normal: {
                                color: '#f69846'
                            }
                        }
                    },
                    {
                        value: 1800,
                        name: '长沙',
                        itemStyle: {
                            normal: {
                                color: '#ff4343'
                            }
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: '#transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    },
                    {
                        value: 0,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: 'transparent'
                            }
                        },
                        label: {
                            show: false
                        },
                        labelLine: {
                            show: false
                        }
                    }
                ]
            }]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }

    //echart_0条形图
    function echart_0() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_0'));

        var app={
            word:[],
            value:[],
        }
        $(document).ready(function () {
        getData();
        console.log(app.word);
        console.log(app.value);
    });
    function  getData() {
        $.ajax({
            url: '/txt_data',
            data: {},
            type: 'POST',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.word = data.word;
                app.value = data.value;
            }
        });
    }
    getData();



        option = {
    backgroundColor: '#00265f',
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    grid: {
        top: '15%',
        right: '3%',
        left: '5%',
        bottom: '12%'
    },
    xAxis: [{
        type: 'category',
        data: app.word,
        axisLine: {
            lineStyle: {
                color: 'rgba(255,255,255,0.12)'
            }
        },
        axisLabel: {
            interval:0,
            rotate:-90 ,
            margin: 10,
            color: '#e2e9ff',
            textStyle: {
                fontSize: 14
            },
        },
    }],
    yAxis: [{
        axisLabel: {
            formatter: '{value}',
            color: '#e2e9ff',
        },
        axisLine: {
            show: false
        },
        splitLine: {
            lineStyle: {
                color: 'rgba(255,255,255,0.12)'
            }
        }
    }],
    series: [{
        type: 'bar',
        data: app.value,
        barWidth: '15px',
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: 'rgba(0,244,255,1)' // 0% 处的颜色
                }, {
                    offset: 1,
                    color: 'rgba(0,77,167,1)' // 100% 处的颜色
                }], false),
                barBorderRadius: [30, 30, 30, 30],
                shadowColor: 'rgba(0,160,221,1)',
                shadowBlur: 4,
            }
        },
        label: {
            normal: {
                show: true,
                lineHeight: 30,
                rotate:-90,
                position: ['12', '-30'],
                color: '#fff',
            }
        }
    }]
};


        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);

    }

    //echart_2湖南省高速公路
    function echart_2() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_2'));

        myChart.setOption({
            series: [{
                type: 'map',
                mapType: 'hunan'
            }]
        });

        var geoCoordMap = {
            '怀化': [109.999867, 27.518949],
            '吉首': [109.741528, 28.332629],
            '张家界': [110.491722, 29.112001],
            '常德': [111.701486, 29.076683],
            '益阳': [112.348741, 28.544124],
            '岳阳': [113.126486, 29.382401],
            '长沙': [113.019455, 28.200103],
            '株洲': [113.163141, 27.8418],
            '湘潭': [112.91977, 27.882141],
            '邵阳': [111.467859, 27.21915],
            '娄底': [112.012438, 27.745506],
            '衡阳': [112.63809, 26.895225],
            '永州': [111.577632, 26.460144],
            '郴州': [113.039396, 25.81497]
        };

        var goData = [
            [{
                name: '张家界'

            }, {
                id: 1,
                name: '常德',
                value: 86
            }],
            [{
                name: '吉首'

            }, {
                id: 1,
                name: '常德',
                value: 86
            }],
            [{
                name: '常德'

            }, {
                id: 1,
                name: '益阳',
                value: 70
            }],
            [{
                name: '益阳'

            }, {
                id: 1,
                name: '长沙',
                value: 95
            }],
            [{
                name: '长沙'

            }, {
                id: 1,
                name: '岳阳',
                value: 70
            }],
            [{
                name: '长沙'

            }, {
                id: 1,
                name: '湘潭',
                value: 80
            }],
            [{
                name: '长沙'

            }, {
                id: 1,
                name: '株洲',
                value: 80
            }],
            [{
                name: '长沙'

            }, {
                id: 1,
                name: '衡阳',
                value: 80
            }],
            [{
                name: '衡阳'

            }, {
                id: 1,
                name: '郴州',
                value: 70
            }],
            [{
                name: '衡阳'

            }, {
                id: 1,
                name: '永州',
                value: 70
            }],
            [{
                name: '湘潭'

            }, {
                id: 1,
                name: '娄底',
                value: 60
            }],
            [{
                name: '娄底'

            }, {
                id: 1,
                name: '邵阳',
                value: 75
            }],
            [{
                name: '邵阳'

            }, {
                id: 1,
                name: '怀化',
                value: 75
            }],
        ];
        //值控制圆点大小
        var backData = [
            [{
                name: '常德'

            }, {
                id: 1,
                name: '张家界',
                value: 80
            }],
            [{
                name: '常德'

            }, {
                id: 1,
                name: '吉首',
                value: 66
            }],
            [{
                name: '益阳'

            }, {
                id: 1,
                name: '常德',
                value: 86
            }],
            [{
                name: '长沙'

            }, {
                id: 1,
                name: '益阳',
                value: 70
            }],
            [{
                name: '岳阳'

            }, {
                id: 1,
                name: '长沙',
                value: 95
            }],
            [{
                name: '湘潭'

            }, {
                id: 1,
                name: '长沙',
                value: 95
            }],
            [{
                name: '株洲'

            }, {
                id: 1,
                name: '长沙',
                value: 95
            }],
            [{
                name: '衡阳'

            }, {
                id: 1,
                name: '长沙',
                value: 95
            }],
            [{
                name: '郴州'

            }, {
                id: 1,
                name: '衡阳',
                value: 80
            }],
            [{
                name: '永州'

            }, {
                id: 1,
                name: '衡阳',
                value: 80
            }],
            [{
                name: '娄底'

            }, {
                id: 1,
                name: '湘潭',
                value: 80
            }],
            [{
                name: '邵阳'

            }, {
                id: 1,
                name: '娄底',
                value: 60
            }],
            [{
                name: '怀化'

            }, {
                id: 1,
                name: '邵阳',
                value: 75
            }],
        ];

        var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
        var arcAngle = function (data) {
            var j, k;
            for (var i = 0; i < data.length; i++) {
                var dataItem = data[i];
                if (dataItem[1].id == 1) {
                    j = 0.2;
                    return j;
                } else if (dataItem[1].id == 2) {
                    k = -0.2;
                    return k;
                }
            }
        }

        var convertData = function (data) {
            var res = [];
            for (var i = 0; i < data.length; i++) {
                var dataItem = data[i];
                var fromCoord = geoCoordMap[dataItem[0].name];
                var toCoord = geoCoordMap[dataItem[1].name];
                if (dataItem[1].id == 1) {
                    if (fromCoord && toCoord) {
                        res.push([{
                            coord: fromCoord,
                        }, {
                            coord: toCoord,
                            value: dataItem[1].value //线条颜色

                        }]);
                    }
                } else if (dataItem[1].id == 2) {
                    if (fromCoord && toCoord) {
                        res.push([{
                            coord: fromCoord,
                        }, {
                            coord: toCoord
                        }]);
                    }
                }
            }
            return res;
        };

        var color = ['#fff', '#FF1493', '#0000FF'];
        var series = [];
        [
            ['1', goData],
            ['2', backData]
        ].forEach(function (item, i) {
            series.push({
                name: item[0],
                type: 'lines',
                zlevel: 2,
                symbol: ['arrow', 'arrow'],
                //线特效配置
                effect: {
                    show: true,
                    period: 6,
                    trailLength: 0.1,
                    symbol: 'arrow', //标记类型
                    symbolSize: 5
                },
                lineStyle: {
                    normal: {
                        width: 1,
                        opacity: 0.4,
                        curveness: arcAngle(item[1]), //弧线角度
                        color: '#fff'
                    }
                },
                edgeLabel: {
                    normal: {
                        show: true,
                        textStyle: {
                            fontSize: 14
                        },
                        formatter: function (params) {
                            var txt = '';
                            if (params.data.speed !== undefined) {
                                txt = params.data.speed;
                            }
                            return txt;
                        },
                    }
                },
                data: convertData(item[1])
            }, {
                type: 'effectScatter',
                coordinateSystem: 'geo',
                zlevel: 2,
                //波纹效果
                rippleEffect: {
                    period: 2,
                    brushType: 'stroke',
                    scale: 3
                },
                label: {
                    normal: {
                        show: true,
                        color: '#fff',
                        position: 'right',
                        formatter: '{b}'
                    }
                },
                //终点形象
                symbol: 'circle',
                //圆点大小
                symbolSize: function (val) {
                    return val[2] / 8;
                },
                itemStyle: {
                    normal: {
                        show: true
                    }
                },
                data: item[1].map(function (dataItem) {
                    return {
                        name: dataItem[1].name,
                        value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
                    };
                })

            });

        });

        option = {
            title: {
                text: '',
                subtext: '',
                left: 'center',
                textStyle: {
                    color: '#fff'
                }
            },
            tooltip: {
                trigger: 'item',
                formatter: '{b}'
            },
            //线颜色及飞行轨道颜色
            visualMap: {
                show: false,
                min: 0,
                max: 100,
                color: ['#31A031', '#31A031']
            },
            //地图相关设置
            geo: {
                map: 'hunan',
                //视角缩放比例
                zoom: 1,
                //显示文本样式
                label: {
                    normal: {
                        show: false,
                        textStyle: {
                            color: '#fff'
                        }
                    },
                    emphasis: {
                        textStyle: {
                            color: '#fff'
                        }
                    }
                },
                //鼠标缩放和平移
                roam: true,
                itemStyle: {
                    normal: {
                        //          	color: '#ddd',
                        borderColor: 'rgba(147, 235, 248, 1)',
                        borderWidth: 1,
                        areaColor: {
                            type: 'radial',
                            x: 0.5,
                            y: 0.5,
                            r: 0.8,
                            colorStops: [{
                                offset: 0,
                                color: 'rgba(175,238,238, 0)' // 0% 处的颜色
                            }, {
                                offset: 1,
                                color: 'rgba(	47,79,79, .2)' // 100% 处的颜色
                            }],
                            globalCoord: false // 缺省为 false
                        },
                        shadowColor: 'rgba(128, 217, 248, 1)',
                        // shadowColor: 'rgba(255, 255, 255, 1)',
                        shadowOffsetX: -2,
                        shadowOffsetY: 2,
                        shadowBlur: 10
                    },
                    emphasis: {
                        areaColor: '#389BB7',
                        borderWidth: 0
                    }
                }
            },
            series: series
        };
        myChart.setOption(option);
    }

    // echart_map饼图
    function echart_map() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_map'));
        var app={
        word1:[],
        count1:[],
        word2:[],
        count2:[]
    };
    $(document).ready(function () {
        getData();
        console.log(app.word1);
        console.log(app.count1);
        console.log(app.word2);
        console.log(app.count2);

    });
    function  getData() {
        $.ajax({
            url: '/data',
            data: {},
            type: 'POST',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.word1 = data.name;
                app.count1 = data.name_num;
                app.word2 = data.wor;
                app.count2 = data.value;
            }
        });
    }
    getData();
    var aa=[];
                for(var i = 0;i<app.word1.length;i++){
                    aa.push({
                        value: app.count1[i],
                        name:app.word1[i]

                    })
                }
    var bb=[]
        for(var i = 0;i<app.word2.length;i++){
                    bb.push({
                        value: app.count2[i],
                        name:app.word2[i]

                    })
                }
        option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                x: 'left',
                data: app.word1,
                textStyle: {
                    color: '#ffff'
                    }
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '30%'],

                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data:aa
                },
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: ['40%', '55%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            // shadowBlur:3,
                            // shadowOffsetX: 2,
                            // shadowOffsetY: 2,
                            // shadowColor: '#999',
                            // padding: [0, 7],
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                // abg: {
                                //     backgroundColor: '#333',
                                //     width: '100%',
                                //     align: 'right',
                                //     height: 22,
                                //     borderRadius: [4, 4, 0, 0]
                                // },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },
                    data: bb
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });

    }

    //echart_3交通就业人员
    function echart_3() {
        var myChart = echarts.init(document.getElementById('chart_3'));
        myChart.clear();
        option = {

            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['铁路运输业', '公路运输业', '水上运输业', '航空运输业', '管道运输业', '装卸搬运和其他运输服务业', '等外公路公路里程'],
                textStyle: {
                    color: '#fff'
                },
                top: '4%'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                orient: 'vertical',
                right: '1%',
                top: '2%',
                iconStyle: {
                    color: '#FFEA51',
                    borderColor: '#FFA74D',
                    borderWidth: 1,
                },
                feature: {
                    saveAsImage: {},
                    magicType: {
                        show: true,
                        type: ['line', 'bar', 'stack', 'tiled']
                    }
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2014年', '2015年', '2016年', '2017年', '2018年'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: {
                name: '人',
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            series: [
                {
                    name: '铁路运输业',
                    type: 'line',
                    data: [57197, 51533, 57000, 58150, 55748]
                },
                {
                    name: '公路运输业',
                    type: 'line',
                    data: [148054, 150198, 144943, 138157, 114234]
                },
                {
                    name: '水上运输业',
                    type: 'line',
                    data: [27100, 25568, 25734, 24393, 23851]
                },
                {
                    name: '航空运输业',
                    type: 'line',
                    data: [1795, 3306, 4151, 5538, 4766]
                },
                {
                    name: '管道运输业',
                    type: 'line',
                    data: [1586, 567, 647, 1235, 1186]
                },
                {
                    name: '装卸搬运和其他运输服务业',
                    type: 'line',
                    data: [4448, 11742, 12706, 10666, 10902]
                }
            ]
        };
        myChart.setOption(option);
    }

    //中国铁路
    function echart_4() {
        // 基于准备好的dom，初始化echarts图表
        var myChart = echarts2.init(document.getElementById('chart_4'));
        var app={
        word1:[],
        num1:[]
    };
        function  getData() {
        $.ajax({
            url: '/data',
            data: {},
            type: 'POST',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.word1 = data.name;
                app.num1 = data.name_num;

            }
        });
    }
    getData();
        $(document).ready(function () {
            getData();
            console.log(app.word1);
            console.log(app.num1);
        });

        option = {
            title: {
                text: '世界人口总量',
                subtext: '数据来自网络'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            yAxis: {
                type: 'category',
                data: app.word1
            },
            series: [
                {
                    name: '2011年',
                    type: 'bar',
                    data:app.num1
                },
            ]
        };

        // 为echarts对象加载数据
        myChart.setOption(option);
    }


    //词云图
    function echart_6() {

        var myChart = echarts.init(document.getElementById('chart_6'));
    var app={
        word1:[],
        count1:[]
    };
    $(document).ready(function () {
        getData();
        console.log(app.word1);
        console.log(app.count1);

    });
    function  getData() {
        $.ajax({
            url: '/txt_data',
            data: {},
            type: 'get',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.word1 = data.word;
                app.count1 = data.value;
            }
        });
    }
    getData();
    var aa=[];
                for(var i = 0;i<app.word1.length;i++){
                    aa.push({
                        name:app.word1[i],
                        value: app.count1[i]
                    })
                }
                var data=aa

                //温馨提示：‘image 选取有严格要求不可过大；，否则firefox不兼容  iconfont上面的图标可以
                var maskImage = new Image();
                maskImage.src = "../static/images/2.jpg"


                    option={
                        // backgroundColor: '#fff',
                        tooltip: {
                            show: false
                        },
                        series: [{
                                type: 'wordCloud',
                                gridSize: 2,
                                sizeRange: [12, 40],
                                rotationRange: [-45, 0, 45, 90],
                               maskImage: maskImage,
                                textStyle: {
                                    normal: {
                                        color: function () {
                                            return 'rgb(' +
                                                    Math.round(Math.random() * 255) +
                                                    ', ' + Math.round(Math.random() * 255) +
                                                    ', ' + Math.round(Math.random() * 255) + ')'
                                        }
                                    }
                                },
                                left: 'center',
                                top: 'center',
                                // width: '96%',
                                // height: '100%',
                                right: null,
                                bottom: null,
                                // width: 300,
                                // height: 200,
                                // top: 20,
                                data: data
                            }]
                    };
                myChart.setOption(option);
    }


    //湖南总货运量
    function echart_7() {
        var myChart = echarts.init(document.getElementById('chart_7'));
        myChart.clear();
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['货运量', '铁路货运量', '国家铁路货运量', '地方铁路货运量', '合资铁路货运量', '公路货运量', '水运货运量'],
                textStyle: {
                    color: '#fff'
                },
                top: '4%'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                orient: 'vertical',
                right: '1%',
                top: '2%',
                iconStyle: {
                    color: '#FFEA51',
                    borderColor: '#FFA74D',
                    borderWidth: 1,
                },
                feature: {
                    saveAsImage: {},
                    magicType: {
                        show: true,
                        type: ['line', 'bar', 'stack', 'tiled']
                    }
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2012年', '2013年', '2014年', '2015年', '2016年'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: {
                name: '单位(万吨)',
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            series: [
                {
                    name: '货运量',
                    type: 'line',
                    data: [219130, 198009, 209946, 198024, 210586]
                },
                {
                    name: '铁路货运量',
                    type: 'line',
                    data: [21010, 22469, 20619, 17843, 16313]
                },
                {
                    name: '国家铁路货运量',
                    type: 'line',
                    data: [17866, 19354, 17589, 17709, 18589]
                },
                {
                    name: '地方铁路货运量',
                    type: 'line',
                    data: [3034, 2845, 2712, 2790, 2812]
                },
                {
                    name: '合资铁路货运量',
                    type: 'line',
                    data: [111, 271, 318, 327, 349]
                },
                {
                    name: '公路货运量',
                    type: 'line',
                    data: [195530, 172492, 185286, 175637, 189822]
                },
                {
                    name: '水运货运量',
                    type: 'line',
                    data: [2590, 3048, 4041, 4544, 4451]
                }
            ]
        };
        myChart.setOption(option);
    }

    //湖南货物周转量
    function echart_8() {
        var myChart = echarts.init(document.getElementById('chart_8'));
        myChart.clear();
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['铁路货物周转量', '国家铁路货物周转量', '地方铁路货物周转量', '合资铁路货物周转量', '公路货物周转量', '水运货物周转量'],
                textStyle: {
                    color: '#fff'
                },
                top: '4%'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                orient: 'vertical',
                right: '1%',
                top: '2%',
                iconStyle: {
                    color: '#FFEA51',
                    borderColor: '#FFA74D',
                    borderWidth: 1,
                },
                feature: {
                    saveAsImage: {},
                    magicType: {
                        show: true,
                        type: ['line', 'bar', 'stack', 'tiled']
                    }
                }
            },
            color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2014年', '2015年', '2016年', '2017年', '2018年'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: {
                name: '亿吨公里',
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            series: [
                {
                    name: '铁路货物周转量',
                    type: 'line',
                    data: [3961.88, 4233.63, 4183.14, 3633.01, 3704.47]
                },
                {
                    name: '国家铁路货物周转量',
                    type: 'line',
                    data: [3374.76, 3364.76, 3274.76, 3371.82, 3259.87]
                },
                {
                    name: '地方铁路货物周转量',
                    type: 'line',
                    data: [14.77, 15.17, 13.17, 14.56, 15.84]
                },
                {
                    name: '合资铁路货物周转量',
                    type: 'line',
                    data: [686.17, 847.26, 895.22, 865.28, 886.72]
                },
                {
                    name: '公路货物周转量',
                    type: 'line',
                    data: [6133.47, 6577.89, 7019.56, 6821.48, 7294.59]
                },
                {
                    name: '水运货物周转量',
                    type: 'line',
                    data: [509.60, 862.54, 1481.77, 1552.79, 1333.62]
                }
            ]
        };
        myChart.setOption(option);
    }

    //湖南运输线长度
    function echart_9() {
        var myChart = echarts.init(document.getElementById('chart_9'));
        myChart.clear();
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['铁路营业里程', '公路里程', '等级公路里程', '高速等级公路里程', '一级等级公路里程', '二级等级公路里程', '等外公路公路里程'],
                textStyle: {
                    color: '#fff'
                },
                top: '4%'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                orient: 'vertical',
                right: '1%',
                top: '2%',
                iconStyle: {
                    color: '#FFEA51',
                    borderColor: '#FFA74D',
                    borderWidth: 1,
                },
                feature: {
                    saveAsImage: {},
                    magicType: {
                        show: true,
                        type: ['line', 'bar', 'stack', 'tiled']
                    }
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2014年', '2015年', '2016年', '2017年', '2018年'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: {
                name: '万公里',
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            series: [
                {
                    name: '铁路营业里程',
                    type: 'line',
                    data: [0.56, 0.63, 0.63, 0.70, 0.70]
                },
                {
                    name: '公路里程',
                    type: 'line',
                    data: [16.30, 17.45, 17.92, 18.46, 18.84]
                },
                {
                    name: '等级公路里程',
                    type: 'line',
                    data: [15.54, 16.77, 17.29, 17.86, 18.26]
                },
                {
                    name: '高速等级公路里程',
                    type: 'line',
                    data: [0.51, 0.56, 0.59, 0.63, 0.65]
                },
                {
                    name: '一级等级公路里程',
                    type: 'line',
                    data: [0.47, 0.48, 0.51, 0.54, 0.56]
                },
                {
                    name: '二级等级公路里程',
                    type: 'line',
                    data: [1.76, 1.85, 1.93, 1.97, 1.99]
                },
                {
                    name: '等外公路公路里程',
                    type: 'line',
                    data: [0.76, 0.68, 0.63, 0.60, 0.58]
                }
            ]
        };
        myChart.setOption(option);
    }

    //湖南省快递业务量
    function echart_10() {
        var myChart = echarts.init(document.getElementById('chart_10'));
        myChart.clear();

        option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                x: 'left',
                top: '2%',
                left: '1%',
                textStyle: {
                    color: '#fff'
                },
                data: [
                    '国际', '省外', '省内',
                ]
            },
            color: ['#FF4949', '#FFA74D', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1', '#4BF0FF', '#44AFF0'],
            series: [
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['28%', '28%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 90392.39, name: '2018年业务量(90392.39万件)'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['28%', '28%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },
                    data: [
                        {value: 464.43, name: '国际'},
                        {value: 68575.6, name: '省外'},
                        {value: 21352.36, name: '省内'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['70%', '28%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 54911.94, name: '2017年业务量(54911.94万件)'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['70%', '28%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },
                    data: [
                        {value: 278.5, name: '国际'},
                        {value: 37111.03, name: '省外'},
                        {value: 17522.41, name: '省内'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['28%', '70%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 34019.15, name: '2016年业务量(34019.15万件)'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['28%', '70%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },
                    data: [
                        {value: 163.72, name: '国际'},
                        {value: 26841.29, name: '省外'},
                        {value: 7014.14, name: '省内'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['70%', '70%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 20755.74, name: '2015年业务量(20755.74万件)'},
                    ]
                },
                {
                    name: '业务量(万件)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['70%', '70%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },
                    data: [
                        {value: 129.65, name: '国际'},
                        {value: 18072.54, name: '省外'},
                        {value: 2553.55, name: '省内'},
                    ]
                },
            ]
        };

        myChart.setOption(option);
    }

    //湖南省公路营运
    function echart_11() {
        var myChart = echarts.init(document.getElementById('chart_11'));
        myChart.clear();

        option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            legend: {
                x: 'left',
                top: '2%',
                left: '1%',
                textStyle: {
                    color: '#fff'
                },
                data: ['公路营运载客', '公路营运载货']
            },
            color: ['#FF4949', '#FFA74D', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            series: [
                {
                    name: '公路营运',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['28%', '28%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 145.18, name: '2018年公路营运拥有量(145.18万辆)'},
                    ]
                },
                {
                    name: '汽车拥有量(万辆)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['28%', '28%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            position: 'outside',
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },

                    data: [
                        {value: 142.65, name: '公路营运载客'},
                        {value: 2.53, name: '公路营运载货'},
                    ]
                },
                {
                    name: '公路营运',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['70%', '28%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 142.47, name: '2017年公路营运拥有量(142.47万辆)'}
                    ]
                },
                {
                    name: '汽车拥有量(万辆)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['70%', '28%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            position: 'outside',
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },

                    data: [
                        {value: 139.95, name: '公路营运载客'},
                        {value: 2.52, name: '公路营运载货'},
                        // {value:137.96, name:'2014年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.65, name:'2014年公路营运载货汽车拥有量(万辆)'},
                        // {value:131.48, name:'2013年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.97, name:'2013年公路营运载货汽车拥有量(万辆)'}
                    ]
                },
                {
                    name: '公路营运',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['28%', '70%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 140.61, name: '2016年公路营运拥有量(140.61万辆)'},
                        // {value:142.47, name:'2015年公路营运拥有量(142.47万辆)'},
                        // {value:140.61, name:'2014年公路营运拥有量(140.61万辆)'},
                        // {value:134.45, name:'2013年公路营运拥有量(134.45万辆)'},
                    ]
                },
                {
                    name: '汽车拥有量(万辆)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['28%', '70%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            position: 'outside',
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },

                    data: [
                        {value: 137.96, name: '公路营运载客'},
                        {value: 2.65, name: '公路营运载货'},
                        // {value:137.96, name:'2014年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.65, name:'2014年公路营运载货汽车拥有量(万辆)'},
                        // {value:131.48, name:'2013年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.97, name:'2013年公路营运载货汽车拥有量(万辆)'}
                    ]
                },
                {
                    name: '公路营运',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '15%'],
                    center: ['70%', '70%'],
                    label: {
                        normal: {
                            position: 'inner'
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [
                        {value: 134.45, name: '2015年公路营运拥有量(134.45万辆)'},
                    ]
                },
                {
                    name: '汽车拥有量(万辆)',
                    type: 'pie',
                    radius: ['20%', '30%'],
                    center: ['70%', '70%'],
                    label: {
                        normal: {
                            formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                            backgroundColor: '#eee',
                            borderColor: '#aaa',
                            borderWidth: 1,
                            borderRadius: 4,
                            position: 'outside',
                            rich: {
                                a: {
                                    color: '#999',
                                    lineHeight: 22,
                                    align: 'center'
                                },
                                hr: {
                                    borderColor: '#aaa',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 33
                                },
                                per: {
                                    color: '#eee',
                                    backgroundColor: '#334455',
                                    padding: [2, 4],
                                    borderRadius: 2
                                }
                            }
                        }
                    },

                    data: [
                        {value: 131.48, name: '公路营运载客'},
                        {value: 2.97, name: '公路营运载货'},
                        // {value:137.96, name:'2014年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.65, name:'2014年公路营运载货汽车拥有量(万辆)'},
                        // {value:131.48, name:'2013年公路营运载客汽车拥有量(万辆)'},
                        // {value:2.97, name:'2013年公路营运载货汽车拥有量(万辆)'}
                    ]
                }
            ]
        };

        myChart.setOption(option);
    }

    //湖南省城市公共交通
    function echart_12() {
        var myChart = echarts.init(document.getElementById('chart_12'));
        myChart.clear();
        option = {
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['公共交通运营数', '运营线路总长度', '公共交通客运总量'],
                textStyle: {
                    color: '#fff'
                },
                top: '4%'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                orient: 'vertical',
                right: '1%',
                top: '2%',
                iconStyle: {
                    color: '#FFEA51',
                    borderColor: '#FFA74D',
                    borderWidth: 1,
                },
                feature: {
                    saveAsImage: {},
                    magicType: {
                        show: true,
                        type: ['line', 'bar', 'stack', 'tiled']
                    }
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['2014年', '2015年', '2016年', '2017年', '2018年'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: {
                name: '万公里',
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
            series: [
                {
                    name: '公共交通运营数',
                    type: 'line',
                    data: [16493, 17498, 15977, 18927, 21479]
                },
                {
                    name: '运营线路总长度',
                    type: 'line',
                    data: [18812, 19647, 20305, 22940, 26077]
                },
                {
                    name: '公共交通客运总量',
                    type: 'line',
                    data: [203954, 202727, 205342, 187208, 186048]
                },
            ]
        };
        myChart.setOption(option);
    }

    //湖南省地图//折线图
    function echart_13() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('chart_13'));

         var app={
        word:[],
        keya:[],
        keyb:[],
        keyc:[]
    };
    $(document).ready(function () {
        getData();
        console.log(app.word);
        console.log(app.keya);
        console.log(app.keyb);
        console.log(app.keyc);

    });
    function  getData() {
        $.ajax({
            url: '/da',
            data: {},
            type: 'POST',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.keya = data.keya;
                app.keyb = data.keyb;
                app.keyc = data.keyc;
            }
        });
    }
    getData();
    // var aa=[];
    //             for(var i = 0;i<app.word1.length;i++){
    //                 aa.push({
    //                     value: app.count1[i],
    //                     name:app.word1[i]
    //
    //                 })
    //             }

        option = {

            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data:['大专','本科','硕士']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                "axisLabel":{
    		interval: 0
    	},
                type: 'category',
                boundaryGap: false,
                data: app.word
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name:'大专',
                    type:'line',
                    stack: '总量',
                    data:app.keya
                },
                {
                    name:'本科',
                    type:'line',
                    stack: '总量',
                    data:app.keyb
                },
                {
                    name:'硕士',
                    type:'line',
                    stack: '总量',
                    data:app.keyc
                },
            ]
        };



        myChart.setOption(option);
    }

    //多个饼图
    function echart_14() {
        var myChart = echarts.init(document.getElementById('chart_14'));

        var app={
        word:[],
        count:[],
        counta:[],
        countb:[],
        countc:[],
        countd:[],
        counte:[],
        countf:[],
        countg:[],
        worda:[],
        wordb:[],
        wordc:[],
        wordd:[],
        worde:[],
        wordf:[],
        wordg:[],
    };
    $(document).ready(function () {
        getData();
        console.log(app.word);
        console.log(app.count);
        console.log(app.counta);
        console.log(app.countb);
        console.log(app.countc);
        console.log(app.countd);
        console.log(app.counte);
        console.log(app.countf);
        console.log(app.countg);

    });
    function  getData() {
        $.ajax({
            url: '/dat',
            data: {},
            type: 'POST',
            async: false,
            dataType: 'json',
            success: function (data) {
                app.word = data.name;
                app.count = data.name_num;
                app.counta = data.keya;
                app.countb = data.keyb;
                app.countc = data.keyc;
                app.countd = data.keyd;
                app.counte = data.keye;
                app.countf = data.keyf;
                app.countg = data.keyg;
                app.worda = data.worda;
                app.wordb = data.wordb;
                app.wordc = data.wordc;
                app.wordd = data.wordd;
                app.worde = data.worde;
                app.wordf = data.wordf;
                app.wordg = data.wordg;
            }
        });
    }
    getData();
    var aa=[];
                for(var i = 0;i<app.word.length;i++){
                    aa.push({
                        name:app.word[i],
                         icon:'circle',
                    })
                }
    var bb=[]
        for(var i = 0;i<app.word.length;i++){
                    bb.push({
                        value: app.count[i],
                        name:app.word[i]
                    })
                }
    var aaa=[]
        for(var i = 0;i<app.worda.length;i++){
                    aaa.push({
                        value: app.counta[i],
                        name:app.worda[i]
                    })
                }
        var bbb=[]
        for(var i = 0;i<app.wordb.length;i++){
                    bbb.push({
                        value: app.countb[i],
                        name:app.wordb[i]
                    })
                }
        var ccc=[]
        for(var i = 0;i<app.wordc.length;i++){
                    ccc.push({
                        value: app.countc[i],
                        name:app.wordc[i]
                    })
                }
        var ddd=[]
        for(var i = 0;i<app.wordd.length;i++){
                    ddd.push({
                        value: app.countd[i],
                        name:app.wordd[i]
                    })
                }
        var eee=[]
        for(var i = 0;i<app.worde.length;i++){
                    eee.push({
                        value: app.counte[i],
                        name:app.worde[i]
                    })
                }
        var fff=[]
        for(var i = 0;i<app.wordf.length;i++){
                    fff.push({
                        value: app.countf[i],
                        name:app.wordf[i]
                    })
                }
        var ggg=[]
        for(var i = 0;i<app.wordg.length;i++){
                    ggg.push({
                        value: app.countg[i],
                        name:app.wordg[i]
                    })
                }
        var option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            // legend: {
            //     x: 'right',
            //     orient: 'horizontal',
            //     //width: 350,      //图行例组件的宽度,默认自适应
            //     x: 'right',  //图例显示在右边  设置数字就是离左边多远
            //     top: 50,   //图例在垂直方向上面显示居中
            //     itemWidth: 30,  //图例标记的图形宽度
            //     itemHeight: 10, //图例标记的图形高度
            //     itemGap: 15,
            //     data: aa,
            //     textStyle: {
            //         color: '#ffff'
            //         },
            // },
            color: ['#36e4bb', '#ea97dd', '#7493e5', '#a99cf4', '#fd87ab', '#34abec', '#ebc54a', '#fff45c', '#b3d465', '#cadd9c',],
            series: [
                /*大饼*/
                {
                    name: '大数据岗位',
                    type: 'pie',
                    radius: '60%',
                    center: ['20%', '50%'],
                    data: bb,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',
                                formatter:'{b}{c}'//平常不显示
                            },
                        },
                    },
                },
                /*第一个小饼*/
                {
                    name: app.word[0],
                    type: 'pie',
                    radius:['12%','18%'],
                    center: ['45%', '35%'],
                    //color: ['#36e4bb', '#eeeeee'],
                    data: aaa,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },
                {
                    name: app.word[1],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['60%', '35%'],
                    //color: ['#ea97dd', '#eee'],
                    data: bbb,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },
                {
                    name: app.word[2],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['75%', '35%'],
                    //color: ['#7493e5', '#eeeeee'],
                    data:ccc,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },
                {
                    name: app.word[3],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['90%', '35%'],
                    //color: ['a99cf4', '#eeeeee'],
                    data: ddd,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },

                {
                    name: app.word[4],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['45%', '60%'],
                    //color: ['#34abec', '#eeeeee'],
                    data: eee,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },
                {
                    name: app.word[5],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['60%', '60%'],
                    //color: ['#ebc54a', '#eeeeee'],
                    data:fff,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },
                {
                    name: app.word[6],
                    type: 'pie',
                    radius: ['12%','18%'],
                    center: ['75%', '60%'],
                    //color: ['#fff45c', '#eeeeee'],
                    data: ggg,
                    itemStyle: {  //图形样式
                        normal: { //normal 是图形在默认状态下的样式；emphasis 是图形在高亮状态下的样式，比如在鼠标悬浮或者图例联动高亮时。
                            label: {  //饼图图形上的文本标签
                                show: true ,
                                position:'inner',  //平常不显示
                            },
                        },
                    },
                },

            ]
        };
        // 使用刚指定的配置项和数据显示图表。

        myChart.setOption(option);

    }

    //操作按钮
    $('.t_btn0').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos0').css('display', 'block');
        echart_map();
    });
    $('.t_btn1').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos1').css('display', 'block');
        echart_2();
    });
    $('.t_btn2').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos2').css('display', 'block');
        echart_0();
    });
    $('.t_btn3').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos3').css('display', 'block');
        echart_4();
    });
    $('.t_btn4').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos6').css('display', 'block');
        echart_6();
    });
    $('.t_btn5').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos4').css('display', 'block');
        echart_1();
    });
    $('.t_btn6').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos5').css('display', 'block');
        echart_3();
    });
    $('.t_btn7').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos7').css('display', 'block');
        echart_7();
    });
    $('.t_btn8').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos8').css('display', 'block');
        echart_8();
    });
    $('.t_btn9').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos9').css('display', 'block');
        echart_9();
    });
    $('.t_btn10').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos10').css('display', 'block');
        echart_10();
    });
    $('.t_btn11').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos11').css('display', 'block');
        echart_11();
    });
    $('.t_btn12').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos12').css('display', 'block');
        echart_12();
    });
    $('.t_btn13').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos13').css('display', 'block');
        echart_13();
    });
    $('.t_btn14').click(function () {
        $('.center_text').css('display', 'none');
        $('.t_cos14').css('display', 'block');
        echart_14();
    });
    //获取地址栏参数
    $(function () {
        function getUrlParms(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)
                return unescape(r[2]);
            return null;
        }

        var id = getUrlParms("id");
        if (id == 2) {
            $('.center_text').css('display', 'none');
            $('.t_cos10').css('display', 'block');
            echart_10();
        }
        if (id == 3) {
            $('.center_text').css('display', 'none');
            $('.t_cos11').css('display', 'block');
            echart_11();
        }
        if (id == 4) {
            $('.center_text').css('display', 'none');
            $('.t_cos1').css('display', 'block');
            echart_2();
        }
        if (id == 5) {
            $('.center_text').css('display', 'none');
            $('.t_cos6').css('display', 'block');
            echart_6();
        }
        if (id == 6) {
            $('.center_text').css('display', 'none');
            $('.t_cos4').css('display', 'block');
            echart_1();
        }
        if (id == 7) {
            $('.center_text').css('display', 'none');
            $('.t_cos8').css('display', 'block');
            echart_8();
        }
        if (id == 8) {
            $('.center_text').css('display', 'none');
            $('.t_cos12').css('display', 'block');
            echart_12();
        }
        if (id == 9) {
            $('.center_text').css('display', 'none');
            $('.t_cos13').css('display', 'block');
            echart_13();
        }
    });
});
